import multiprocessing
import os
import time


def sing(msg):
    while True:
        print(multiprocessing.current_process().name, os.getpid(), os.getppid(), msg)
        time.sleep(1)


def dance(msg):
    while True:
        print(multiprocessing.current_process().name, os.getpid(), os.getppid(), msg)
        time.sleep(1)


if __name__ == '__main__':
    print(multiprocessing.current_process().name, os.getpid())
    p1 = multiprocessing.Process(target=sing, args=('sing...',),daemon= True)
    p2 = multiprocessing.Process(target=dance, args=('dance...',),daemon= True)
    p1.start()
    time.sleep(0.5)
    p2.start()

    time.sleep(6)
